<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>CK宠物网  个人空间  认证买家资格</title>
    <jsp:include page="top_utils.jsp"></jsp:include>
    <script type="text/javascript" src="${pageContext.request.contextPath}/jquery/jquery.min.js"></script>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/myplace.css"/>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/myspace.css">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/my_adopt.css">
  </head>
  
  <body>
 	<!-- 头部-->
	<div class="headnav">
		<div class="topBar">
			<div class="topBarL">
				<jsp:include page="logo.jsp"></jsp:include>
				<div class="nav">
					<ul>
						<li>
							<a href="${pageContext.request.contextPath }/">首页</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath }/news/">新闻</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath }/adopt/">领养</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath }/knowledge/">知识</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath }/shopping/">商城</a>
						</li>
					</ul>
				</div>
			</div>

			<jsp:include page="topBarR.jsp"></jsp:include>
		</div>
	</div>
 	
	<div id="main" style="background:url('/dogstore/images/${user.backimg}')  no-repeat center top;">
	  <jsp:include page="my_top.jsp"></jsp:include>
	  
	  <div class="layout-body">
	    <div class="w960  clf">   
	      <div class="m_main">
	        <div class="inner centers_mr"> 
     			<c:if test="${user.issale_power == 0 }">
     				<div class="public_m2">你已被取消卖家资格!不能发布，只能查看历史发布了的领养信息!</div>
     			</c:if>
     			<c:if test="${user.issale_power == 1 }">
     				<div class="public_m2">你已被授权卖家资格</div>
				</c:if>
     			
     			<a class="layui-btn layui-btn-small" href="${pageContext.request.contextPath }/user/myspace">返回个人主页</a>
				<a class="layui-btn layui-btn-small" onclick="javascript:history.back(-1);">返回上一步</a>
				<br/>
				<br/>
	     		<div class="tip_notem">
	     			<ul>
	     				<li>1. 改模块是你已经发布了的领养</li>
		     			<li>2. 如果私下联系通过，则你可以点击确认认领，生成认领单</li>
		     			<li>3. 认领单生成表示交易通过，你将不可修改，若修改，则联系管理员，请慎重!</li>
	     			</ul>
	     			<br/>
	     			
	     			<style>
	     				.layui-table th{
	     					float:none;
	     				}
	     			</style>
	            	
	            	<div class="public_m1">
			        	<div class="public_m2">审核认领人</div>
			            <!--照片和内容-->	
			            <div class="zp_nrm">
			            	
			                <!--right-->
			                <div class="zp_nrm_r">
			                	<p><em>申请人：</em><i>${adopt.recvuser.username }</i></p>
			                    <p>
			                    	<em>邮&nbsp;箱：</em>
			                    	<c:if test="${adopt.recvuser.email != null && adopt.recvuser.email != ''}">
			                    		<i>${adopt.recvuser.email }</i>
			                    	</c:if>
			                    	<c:if test="${adopt.recvuser.email == null || adopt.recvuser.email == ''}">
			                    		<i>未绑定</i>
			                    	</c:if>
			                    </p>
			                    <p>
			                    	<em>手机号：</em>
			                    	<c:if test="${adopt.recvuser.phone != null && adopt.recvuser.phone != ''}">
			                    		<i>${adopt.recvuser.phone }</i>
			                    	</c:if>
			                    	<c:if test="${adopt.recvuser.phone == null || adopt.recvuser.phone == ''}">
			                    		<i>未绑定</i>
			                    	</c:if>
			                    </p>
			                    <p><em>标题：</em><i>${adopt.title }</i></p>
			                    <p><em>照片：</em>
			                    	<img title="${pageContext.request.contextPath}/images/${adopt.coverimg }" style="height: 60px;width: 60px;" src="${pageContext.request.contextPath}/images/${adopt.coverimg }">
			                    	
			                    </p>
			                    <p><em>信息：</em>${adopt.html }</i></p>
			                    <br/>
			                    <br/>
			                    <br/>
			                    <a class="layui-btn layui-btn-small" id="${adopt.id }" onclick="looksend_sub(this.id)">申请通过</a>
			                </div>
			            </div>
	        		</div>
	            </div>
	        </div>
	      </div>
	      
	    </div>
	  </div>
	</div>
	
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/my_adopt.css">
	<jsp:include page="footer.jsp"></jsp:include>
  </body>
  <script type="text/javascript" charset="utf-8" src="${pageContext.request.contextPath }/js/head.js"></script>
  <script>
  	window.onload=function (){
		if(${user == null}){
			layer.msg("你未登录!",{shift: 6});
			setTimeout(function (){
				window.location.href="/dogstore/";
			},1500);
		}
 	};
 	
 	
 	
 	$(document).ready(function(){
 		
 	});
 	
 	
 	function looksend_sub(id){
 		$.ajax({
 			type:"post",
			url:"/dogstore/adopt/fortrue_adopt.action",
			async:false, 
 			data:{
 				id:id
 			},
 			success:function (error){
 				if(error == "0"){
 					layer.msg("审核成功!已加入领养单!",{icon: 1,shift: 1});
 					setTimeout(function (){
						//刷新
						window.location.href="/dogstore/adopt/my_allSendAdopts";
					},1000);
 				}else{
 					layer.msg("审核失败!请联系prince!500",{icon: 2,shift: 6});
 				}
 			},
 			error:function (){
 				layer.msg("提交失败!请联系prince!",{icon: 2,shift: 6});
 			} 			
 		},"json");
 	}
 	
 	function del(id){
 		$.ajax({
 			type:"post",
			url:"/dogstore/adopt/deleteAdopt.action",
			async:false, 
 			data:{
 				id:id
 			},
 			success:function (error){
 				if(error == "0"){
 					layer.msg("删除成功!",{icon: 1,shift: 1});
 					setTimeout(function (){
						//刷新
						window.location.href="/dogstore/adopt/my_allSendAdopts";
					},1000);
 				}else{
 					layer.msg("数据删除失败!请联系prince!500",{icon: 2,shift: 6});
 				}
 			},
 			error:function (){
 				layer.msg("提交失败!请联系prince!",{icon: 2,shift: 6});
 			} 			
 		},"json");
 	}
  </script>
</html>
